//
//  AppDelegate.m
//  02.XMPP框架的导入
//
//  Created by apple on 14/12/6.
//  Copyright (c) 2014年 heima. All rights reserved.
//

#import "AppDelegate.h"
#import "DDLog.h"
#import "DDTTYLogger.h"



@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //打开xmpp日志
    [DDLog addLogger:[DDTTYLogger sharedInstance]];
    
//    // 程序一启动就连接到主机
//    [self connectToHost];
    [[WCUserInfo sharedWCUserInfo] loadUserInfoFromSandbox];
    
    //判断有没有登录过
    if ([WCUserInfo sharedWCUserInfo].loginStatus) {
        UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        self.window.rootViewController = storyBoard.instantiateInitialViewController;
        
        //自动登录到服务器
        [[WCXMPPTool sharedWCXMPPTool] xmppUserLogin:nil];
    }
    return YES;
}




@end
